<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商户列表—<s:property value="#application.website.websiteName"/></title>
<link href="css/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/tools/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/tools/public.js"></script>
</head>
<body>
<div id="background">
<img src="<s:property value="#application.website.bgimg"/>">
</div>
<div id="wrap">
	<jsp:include page="../header.jsp"></jsp:include>
<div id="ind_main">
	
        <div class="m_l">
        	<ul>
        	<s:iterator value="list" id="id">
        	    <li>
                	<div class="tx f_l">
                    	<a href="business!businessDetial.action?business.id=<s:property value="#id[0].id"/>"><img src="<s:property value="#id[0].image"/>" /></a>
                    </div>
                    <div class="m_l_n f_r">
                    	<h1><a href="business!businessDetial.action?business.id=<s:property value="#id[0].id"/>"><s:property value="#id[0].name"/></a></h1>
                    	<p>
                    	   <s:property value="@cn.vw.hi.commen.tools.Helper@deleteHtml(#id[0].content,90,'...')"/>
                        </p>
                        <h3><a href="business!businessDetial.action?business.id=<s:property value="#id[0].id"/>">点击进入详情</a></h3>
                    </div>
                </li>
        	</s:iterator>
            </ul>
        </div><!--end.m_l-->
        
        <div class="m_r">
        	<ul>
            	<li>
            	<div class="ad_top"></div>
                <div class="ad_bg"><a href="<s:property value="#application.ad[0].url"/>"><img src="<s:property value="#application.ad[0].image"/>" /></a></div>
                <div class="ad_foot"></div>
            	</li>
                <li>
                <div class="ad_top"></div>
                <div class="ad_bg"><a href="<s:property value="#application.ad[1].url"/>"><img src="<s:property value="#application.ad[1].image"/>" /></a></div>
                <div class="ad_foot"></div>
                </li>
            </ul>
        </div><!--end.m_r-->
		<div class="clear"></div> 
        <div class="pagination">
         <s:if test="#request.list.size()!=0">
				   <s:set name="pageUrl" >business!businessList.action?searchStr=${ searchStr}&page=</s:set>
		      <a class="disabled" href="${pageUrl}1">第一页</a>
		      <a class="disabled" href="${pageUrl}<s:property value="#request.pageObj.prePage"/>">&lt; 上一页 </a>
		      <s:set name="totalPage" value="#request.pageObj.totalPage"></s:set>
		      <s:set name="currentPage" value="#request.pageObj.currentPage"></s:set>
							   <s:if test="#currentPage<=0">
							      <s:set name="currentPage" value="1"></s:set>
							   </s:if>
							   <s:elseif test="#currentPage>#totalPage">
							      <s:set name="currentPage" value="#totalPage"></s:set>
							   </s:elseif>
							   
							   <s:if test="#totalPage%6>0">
							       <s:set name="pageSize" value="#totalPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="pageSize" value="#totalPage/6"></s:set>
							   </s:else>
							   <s:if test="#currentPage%6>0">
							       <s:set name="cPageSize" value="#currentPage/6+1"></s:set>
							   </s:if>
							   <s:else>
							       <s:set name="cPageSize" value="#currentPage/6"></s:set>
							   </s:else>
							   <s:set name="first" value="6*(#cPageSize-1)"></s:set>
							   <s:if test="#first==0">
							      <s:set name="first" value="1"></s:set>
							   </s:if>
							   <s:set name="last" value="#cPageSize*6"></s:set>
							   <s:if test="#last>#totalPage">
							      <s:set name="last" value="#totalPage"></s:set>
							   </s:if>
				
							     <s:bean name="org.apache.struts2.util.Counter" id="counter"> 
							       <s:param name="first" value="#first"/>
							       <s:param name="last" value="#last" />
							       <s:iterator status="status"> 
							         <s:if test="#currentPage==(#status.index+#first)">
							            <s:a href="%{pageUrl}%{#status.index+#first}" class="current"><s:property value="#status.index+#first" /></s:a>
							         </s:if>
							         <s:else>
							           <s:a href="%{pageUrl}%{#status.index+#first}" ><s:property value="#status.index+#first" /></s:a>
							         </s:else>
							       </s:iterator> 
							     </s:bean>
							     <s:if test="#last<#totalPage">
							       ......&nbsp;
							     </s:if>
		      <a class="disabled" href="${pageUrl}<s:property value="#request.pageObj.nextPage"/>">下一页 ></a>
		      <a class="disabled" href="${pageUrl}<s:property value="#request.pageObj.totalPage"/>">最后一页</a>
		   </s:if> 
         </div> 
       </div>
   	<div id="bottom">
		<h1>--------------  商场/酒店/饭店 信息提供的平台  -------------</h1>
    </div><!--end#bottom-->
</div><!--end#wrap-->
</body>
</html>

